package com.ethink.warehouse.api.component.enums;

/**
 * @Description: 库存类型
 * @Author: lzy
 * @Date: Created in 2022/11/3 15:02
 * ModifiedBy:
 * Version:
 */
public enum WarehouseInventoryTypeEnum {
    /**
     * 易通宝库存类型定义
     */
    ZP("ZP", "正品"),
    CC("CC", "残次"),
    JS("JS", "机损"),
    XS("XS", "箱损")
    ;

    private String code;
    private String name;

    WarehouseInventoryTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() { return this.code; }

    public String getName() { return this.name; }

    /**
     * 枚举编码值获取枚举
     *
     * @param code
     * @return
     */
    public static WarehouseInventoryTypeEnum valueOfCode(String code) {
        for (WarehouseInventoryTypeEnum value : WarehouseInventoryTypeEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
